package com.taotao.system.domain;

import com.alibaba.fastjson2.JSONObject;
import io.swagger.v3.core.util.Json;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;

/**
 * @className: Test
 * @author: ZhangYuQi
 * @date: 2024/12/12 下午8:41
 * @Version: 1.0
 * @description:
 */

@Data
public  class Test {

    private String fieldId;

    private String fileIdValue;


    //创建一个内部类
    @Data
    public static class Test1 {
        private List<Test> fieldBeans;
    }


    public static void main(String[] args) {
        List<Test> list=new ArrayList<>();
        Test1 test1 = new Test1();
        Test test = new Test();
        test.setFieldId("patientName");
        test.setFileIdValue("测试");
        list.add(test);

        Test test2 = new Test();
        test2.setFieldId("gender");
        test2.setFileIdValue("男");
        list.add(test2);

        Test test3 = new Test();
        test3.setFieldId("age");
        test3.setFileIdValue("35");
        list.add(test3);

        Test test4 = new Test();
        test4.setFieldId("idCardNo");
        test4.setFileIdValue("230503196111108484");
        list.add(test4);

        Test test5 = new Test();
        test5.setFieldId("year");
        test5.setFileIdValue("2024");
        list.add(test5);

        Test test6 = new Test();
        test6.setFieldId("month");
        test6.setFileIdValue("12");
        list.add(test6);

        Test test7 = new Test();
        test6.setFieldId("day");
        test6.setFileIdValue("9");
        list.add(test7);

        test1.setFieldBeans(list);

        System.out.println(JSONObject.toJSONString(test1));



        int[] list1 = {1, 4, 6, 76, 89};
        int[] list2 = {23, 56, 87, 123};

        // 使用并行流合并数组
        int[] mergedArray = IntStream.concat(Arrays.stream(list1), Arrays.stream(list2))//合并数组
                .sorted()//自然排序
                .toArray();//转为数组

        // 打印合并后的数组
        for (int i=0;i<mergedArray.length;i++) {
            System.out.print(mergedArray[i]+" ");
        }



    }
}
